export default {
	state: {
		test: '我就是想测试一下',
		newArr: []
	},
	mutations: {
		GET_ARR(state, e) {
			let newArr  = new Set(state.newArr).add(e);
			state.newArr = [...newArr]
			console.log([...newArr])
		},
		// 获取导航栏信息
		NAVIGATION_INFO() {
			let titleHeight = 0; //状态栏和导航栏的总高度
			let naviBarHeight = 0 //导航栏高度
			const res = uni.getSystemInfoSync()
			const system = res.platform
			let statusBarHeight = res.statusBarHeight; //状态栏高度
			if (system === 'android') {
				titleHeight = (48 + statusBarHeight)
			} else if (system === 'ios') {
				titleHeight = (44 + statusBarHeight)
			}
			naviBarHeight = titleHeight - statusBarHeight
			let systemInfo = {
				system: system,
				titleHeight: titleHeight,
				statusBarHeight: statusBarHeight,
				naviBarHeight: naviBarHeight,
				windowWidth: res.windowWidth,
				windowHeight: res.windowHeight,
			}
			uni.setStorageSync('systemInfo', systemInfo);
		}
	},
	getters: {

	},
	actions: {
		actTest({
			commit
		}, opt) { // commit必须用{}扩起来
			commit('changTest', opt)
		}
	}
}
